

#include "Channel.hpp"
#include "Poller.hpp"

namespace tulun
{
    // class Channel;
    // class EventLoop;
    // class Poller::
    // using ChannelList = std::vector<Channel *>;
    // using ChannelMap = std::map<int, Channel *>;
    // ChannelMap channels_;
    // EventLoop *ownerLoop_;

    Poller::Poller(EventLoop *loop)
        : ownerLoop_(loop)
    {
    }
    Poller::~Poller()
    {
    }
    bool Poller::hasChannel(Channel *channel) const
    {
        ChannelMap::const_iterator it = channels_.find(channel->fd());
        return (it == channels_.end()) ? false : (it->second == channel);
    }

} // namespace tulun